/**
 * 基于 jq & bootstrap 的布局管理器组件
 */
;(function ($, window, document, undefined) {

    /**
     * 布局
     */
    $.layout = function () {
        // alert($.layout.defaults.bodyOnly);



    };

    /**
     * 布局管理器页面初始化
     */
    $.layout.init = function (options, html) {

        options = $.extend({}, $.layout.component, options);

        $($.layout.defaults.appentTo).append(html);

    };

    /**
     * 组件定义
     */
    $.layout.component = function () {
        // 定义组件类型及包含的组件
        const ROWCOLUMN = ["12", "6 6", "8 4", "4 8", "4 4 4", "2 6 4"];
        const BASECSS = [];
        const BASEUTIL = [];
        const BASEJS = [];

        let html = "<h1>xxxxxxxx</h1>";



        $($.layout.defaults.appentTo).append(html);

    };

    // 默认配置
    $.layout.defaults = {
        // only clean the body tagbody
        bodyOnly: true,
        // only allow tags in this array, (white list), contents still rendered
        allowedTags: [],
        // remove tags in this array, (black list), contents still rendered
        removeTags: ["basefont", "center", "dir", "font", "frame", "frameset", "iframe", "isindex", "menu", "noframes", "s", "strike", "u"],
        // array of [attributeName], [optional array of allowed on elements] e.g. [["id"], ["style", ["p", "dl"]]] // allow all elements to have id and allow style on 'p' and 'dl'
        allowedAttributes: [],
        // array of attribute names to remove on all elements in addition to those not in tagAttributes e.g ["width", "height"]
        removeAttrs: [],
        // array of [className], [optional array of allowed on elements] e.g. [["aClass"], ["anotherClass", ["p", "dl"]]]
        allowedClasses: [],
        // format the result
        format: false,
        // format indent to start on
        formatIndent: 0,
        // tags to replace, and what to replace with, tag name or regex to match the tag and attributes
        replace: [
            [["b", "big"], "strong"],
            [["i"], "em"]
        ],
        // styles to replace with tags, multiple style matches supported, inline tags are replaced by the first match blocks are retained
        replaceStyles: [
            [/font-weight:\s*bold/i, "strong"],
            [/font-style:\s*italic/i, "em"],
            [/vertical-align:\s*super/i, "sup"],
            [/vertical-align:\s*sub/i, "sub"]
        ],
        allowComments: false,


        // 默认挂载位置，body
        appentTo: "body"

    };

})(jQuery, window, document);
